package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the jobchage database table.
 * 
 */
@Entity
@NamedQuery(name="Jobchage.findAll", query="SELECT j FROM Jobchage j")
public class Jobchage implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="jobchage_id")
	private Integer jobchageId;

	@Column(name="jobchage_name")
	private String jobchageName;

	private Integer jobchage_Rank;

	//bi-directional many-to-one association to Position
	@OneToMany(mappedBy="jobchage")
	private List<Position> positions;

	public Jobchage() {
	}

	public Integer getJobchageId() {
		return this.jobchageId;
	}

	public void setJobchageId(Integer jobchageId) {
		this.jobchageId = jobchageId;
	}

	public String getJobchageName() {
		return this.jobchageName;
	}

	public void setJobchageName(String jobchageName) {
		this.jobchageName = jobchageName;
	}

	public Integer getJobchage_Rank() {
		return this.jobchage_Rank;
	}

	public void setJobchage_Rank(Integer jobchage_Rank) {
		this.jobchage_Rank = jobchage_Rank;
	}

	public List<Position> getPositions() {
		return this.positions;
	}

	public void setPositions(List<Position> positions) {
		this.positions = positions;
	}

	public Position addPosition(Position position) {
		getPositions().add(position);
		position.setJobchage(this);

		return position;
	}

	public Position removePosition(Position position) {
		getPositions().remove(position);
		position.setJobchage(null);

		return position;
	}

}